<%@page import="com.google.gson.Gson"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="org.json.JSONArray"%>
<%@page import="org.json.JSONObject"%>
<%@page import="java.util.List"%>
<%@page import="org.apache.ibatis.session.SqlSession"%>
<%@page import="com.penta.mybatis.SqlSessionManager"%>
<%@page import="java.util.Enumeration"%>
<%@page import="org.apache.ibatis.session.SqlSessionFactory"%>
<%@ page language="java" contentType="text/json; charset=UTF-8" pageEncoding="UTF-8"%>

<%
Enumeration param1 = request.getParameterNames();

Map item = new HashMap();

while (param1.hasMoreElements() )
{
	String paramKey = param1.nextElement().toString();

	System.out.println("KEY = " + paramKey + " >>> " + "VALUE : " + request.getParameter(paramKey)  );

	item.put(paramKey, request.getParameter(paramKey));
}
SqlSession query = SqlSessionManager.getSqlSessionFactory().openSession();
List selectList = query.selectList("user.selectMT",item);
query.close();

for (int i=0 ; i < selectList.size(); i++)
{
	System.out.println ( selectList.get(i) );
}

Gson gg = new Gson();

System.out.println( gg.toJson(selectList) );
out.println( gg.toJson(selectList) );
%>
